import axios from 'axios';

const instance = axios.create({
  baseURL: 'http://localhost:8001/api',  // 改回8001端口
  // 其它配置
});

instance.interceptors.request.use(config => {
  const token = localStorage.getItem('token');
  if (token) {
    config.headers.token = token;
  }
  return config;
});

export default instance;